package avicit.bdp.dgs.metadata.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;

import org.apache.commons.lang3.StringUtils;

/**
 * 元数据基线版本
 *
 * @author mayi
 */
@ApiModel(value = "MetadataBaseVersionDTO", description = "元数据基线版本")
@Table(name = "bdp_dgs_metadata_base_version")
public class MetadataBaseVersionDTO extends BaseDTO {
  private static final long serialVersionUID = 1L;

  /** 主键ID */
  @LogField
  @ApiModelProperty(value = "主键")
  @FieldRemark(column = "id", field = "id", name = "主键")
  @Column(name = "id")
  @avicit.platform6.core.annotation.log.Id
  @javax.persistence.Id
  private String id;

  /** 数据源ID */
  @LogField
  @ApiModelProperty(value = "数据源ID", name = "datasourceId")
  @FieldRemark(column = "datasource_id", field = "datasourceId", name = "数据源ID")
  private String datasourceId;

  /** 基线版本名称 */
  @ApiModelProperty(value = "基线版本名称", name = "name")
  @FieldRemark(column = "name", field = "name", name = "基线版本名称")
  private String name;

  /** 描述 */
  @ApiModelProperty(value = "描述", name = "remark")
  @FieldRemark(column = "remark", field = "remark", name = "描述")
  private String remark;

  /** 当前基线元数据数量 */
  @ApiModelProperty(value = "当前基线元数据数量", name = "numOfMetadataBaseVersion")
  @FieldRemark(
      column = "num_of_metadata_base_version",
      field = "numOfMetadataBaseVersion",
      name = "当前基线元数据数量")
  private Integer numOfMetadataBaseVersion;

  /** 元数据版本有变更数量 */
  @ApiModelProperty(value = "元数据版本有变更数量", name = "numOfMetadataVersionUpdate")
  @FieldRemark(
      column = "num_of_metadata_version_update",
      field = "numOfMetadataVersionUpdate",
      name = "元数据版本有变更数量")
  private Integer numOfMetadataVersionUpdate;

  /** 元数据新增数量 */
  @ApiModelProperty(value = "元数据新增数量", name = "numOfMetadataAdd")
  @FieldRemark(column = "num_of_metadata_add", field = "numOfMetadataAdd", name = "元数据新增数量")
  private Integer numOfMetadataAdd;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getDatasourceId() {
    return datasourceId;
  }

  public void setDatasourceId(String datasourceId) {
    this.datasourceId = datasourceId;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public Integer getNumOfMetadataBaseVersion() {
    return numOfMetadataBaseVersion;
  }

  public void setNumOfMetadataBaseVersion(Integer numOfMetadataBaseVersion) {
    this.numOfMetadataBaseVersion = numOfMetadataBaseVersion;
  }

  public Integer getNumOfMetadataVersionUpdate() {
    return numOfMetadataVersionUpdate;
  }

  public void setNumOfMetadataVersionUpdate(Integer numOfMetadataVersionUpdate) {
    this.numOfMetadataVersionUpdate = numOfMetadataVersionUpdate;
  }

  public Integer getNumOfMetadataAdd() {
    return numOfMetadataAdd;
  }

  public void setNumOfMetadataAdd(Integer numOfMetadataAdd) {
    this.numOfMetadataAdd = numOfMetadataAdd;
  }

  public String getLogFormName() {
    if (StringUtils.isEmpty(super.logFormName)) {
      return "元数据基线版本";
    } else {
      return super.logFormName;
    }
  }

  public String getLogTitle() {
    if (StringUtils.isEmpty(super.logTitle)) {
      return "元数据基线版本";
    } else {
      return super.logTitle;
    }
  }
}
